<?php

namespace App\Repositories\Transformers;

use App\Models\User;
use League\Fractal\TransformerAbstract;

class UserTransformer extends TransformerAbstract
{
    public function transform(User $user)
    {
        return [
            'user_id' => (string)$user->user_id,
            'nickname' => $user->nickname,
            'sex' => $user->sex,
            'avatar' => $user->avatar,
            'phone' => $user->phone,
            'mini_openid' => $user->mini_openid,
        ];
    }
}
